/**
 * 分享协议管理
 */
class SharePrase{
    public constructor() {
	}
    private static _instance:SharePrase;

    public static instance():SharePrase{
		if(!SharePrase._instance){
			SharePrase._instance = new SharePrase();
		}
		return SharePrase._instance;
	}

    //请求一条广告语和确定发送广告语成功
    //prama.type: 类型 0默认 1图鉴分享
    public requestOneAdvertisement(prama)
    {
        let openid = RoleCache.instance().openid ? RoleCache.instance().openid : '' ;
        let data = {
            openid : openid,
            type :   prama.type
        }
        HttpManager.instance().sendPost(GameConst.httpUrl + 'options/get_share_info', StringUtil.jsonToHttpPostString(data), (e)=>{
            let data = JSON.parse(e);

            if(data && data.data)
            {
                let Prama = {
                    imgUrl:data.data.imgUrl,
                    title:data.data.title,
                    prama:prama
                }
                WeChatgGameManager.instance().share(Prama);         
            }
        })
    }
}

enum ShareId{
	default, // 默认
	share,   //图鉴分享
    double,  //双倍
    addFishpondCnt, //增加鱼塘容量
    FishpondIncome, //鱼塘增益
    oneKeyHanle, //鱼塘一键收益
    Max
}